package jmine.tec.services.export.lenient;

import java.util.Collections;
import java.util.List;

import jmine.tec.services.api.export.EntityExporter;
import jmine.tec.services.api.export.ExporterKey;
import jmine.tec.services.api.export.ReferenceMap;
import jmine.tec.services.io.ServiceBean;

/**
 * @author lundberg
 */
public class LenientEntityExporter implements EntityExporter<Object> {

    private final ExporterKey key;

    /**
     * Construtor
     * 
     * @param key key
     */
    public LenientEntityExporter(ExporterKey key) {
        this.key = key;
    }

    /**
     * {@inheritDoc}
     */
    public List<ServiceBean> export(ReferenceMap referenceMap, Object entity) {
        ServiceBean bean = new ServiceBean();
        bean.setName("Exportador não encontrado para a chave " + this.key);
        return Collections.singletonList(bean);
    }

    /**
     * {@inheritDoc}
     */
    public List<Object> exportAfter(Object entity) {
        return Collections.emptyList();
    }

    /**
     * {@inheritDoc}
     */
    public List<Object> exportBefore(Object entity) {
        return Collections.emptyList();
    }

    /**
     * {@inheritDoc}
     */
    public ExporterKey getExporterKey() {
        throw new UnsupportedOperationException();
    }
}
